using System;

using MettleSystems.dashCommerce.Core;
using MettleSystems.dashCommerce.Core.Caching;
using MettleSystems.dashCommerce.Store;
using SubSonic.Utilities;

namespace MettleSystems.dashCommerce.Web.admin
{
  public partial class sitesettings : MettleSystems.dashCommerce.Controls.AdminPage {

	 #region Member Variables

	 private string view = string.Empty;
	 //private SiteSettings siteSettings = null;

	 #endregion

	 #region Page Events

	 /// <summary>
	 /// Handles the Load event of the Page control.
	 /// </summary>
	 /// <param name="sender">The source of the event.</param>
	 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
	 protected void Page_Load(object sender, EventArgs e) {
		try {
		  view = Utility.GetParameter("view");
		  
		  //LoadSiteSettings();

		  switch (view) {
			 case "w":
				dcWidgets.Visible = true;
				//dcWidgets.SiteSettings = siteSettings;
				break;
				
			 case "b":
				dcBrowsingLog.Visible = true;
				//dcBrowsingLog.SiteSettings = siteSettings;
				break;
			 
			 case "c":
				dcCachingSettings.Visible = true;
				//dcCachingSettings.SiteSettings = siteSettings;
				break;

			 case "gl":
				dcGlobalizationSettings.Visible = true;
				//dcGlobalizationSettings.SiteSettings = siteSettings;
				break;

			 case "i":
				dcImagesSettings.Visible = true;
				//dcImagesSettings.SiteSettings = siteSettings;
				break;

			 case "a":
				dcAnalytics.Visible = true;
				//dcAnalytics.SiteSettings = siteSettings;
				break;

			 case "seo":
				dcSeoSettings.Visible = true;
				//dcSeoSettings.SiteSettings = siteSettings;
				break;

			 case "s":
			 default:
				dcSite.Visible = true;
				//dcSite.SiteSettings = siteSettings;
				break;
		  }
		}
		catch(Exception ex) {
		  Logger.Error(typeof(sitesettings).Name + ".Page_Load", ex);
		  Master.MessageCenter.DisplayCriticalMessage(ex.Message);
		}
	 }

	 #endregion

	 #region Methods

	 #region Private

	 ///// <summary>
	 ///// Loads the site settings.
	 ///// </summary>
	 //private void LoadSiteSettings() {
	 //  siteSettings = SiteSettingCache.GetSiteSettings(); ;
	 //}

	 #endregion

	 #endregion

  }
}
